package com.woniu.aftercare.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 退货凭证图片及相关信息
 * @TableName return_proof
 */
@TableName(value ="return_proof")
@Data
public class ReturnProof implements Serializable {
    /**
     * 退货凭证ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 关联售后单ID
     */
    private Long afterSalesOrderId;

    /**
     * 退货凭证图片URL
     */
    private String proofUrl;

    /**
     * 创建时间
     */
    private Date createdAt;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ReturnProof other = (ReturnProof) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getAfterSalesOrderId() == null ? other.getAfterSalesOrderId() == null : this.getAfterSalesOrderId().equals(other.getAfterSalesOrderId()))
            && (this.getProofUrl() == null ? other.getProofUrl() == null : this.getProofUrl().equals(other.getProofUrl()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getAfterSalesOrderId() == null) ? 0 : getAfterSalesOrderId().hashCode());
        result = prime * result + ((getProofUrl() == null) ? 0 : getProofUrl().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", afterSalesOrderId=").append(afterSalesOrderId);
        sb.append(", proofUrl=").append(proofUrl);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}